<?php

namespace app\mobile\controller;

use app\common\controller\Frontend;
use think\Db;
use think\Request;

class Zhengshu extends Frontend
{

    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';
    protected $layout = '';

    public function index(Request $request)
    {
		$banner=Db::name('banner')->where([
			'type_data'=>1,
			'bannertype_id'=>22
		])->find();
		$this->assign('banner',$banner);
		
		$type=$request->param('type/d',0);
		$this->assign('type',$type);
		
		switch($type){
		    case 0:
		        $title='专有技术认定';
		    break;
		    case 1:
		        $title='专业技能培训';
		    break;
		    default:
		        $title='专有技术认定';
		    break;      
		}
		$this->assign('title',$title);
		
		$keyword=trim($request->param('keyword/s',''));
		$rs='';
		if($keyword!=''){
			switch($type){
				case 0:
					$rs=Db::name('zhengshujishurending')->where(['wanchengdanwei|rendingbianhao|jishumingcheng'=>['like',"%$keyword%"]])->find();
				break;
				case 1:
					$rs=Db::name('zhengshujinengpeixun')->where(['zhengshubianhao|shenfenzhenghao'=>['like',"%$keyword%"]])->find();
				break;
			}
			
		}
		$this->assign('rs',$rs);
		
		$this->assign('xingbie_arr',[0=>'男',1=>'女']);
		
        return $this->view->fetch();
    }
	
	
}
